	 $("a[id=loadImg]").bind("click", function(e) {
     $(this).remove();
     var picBox = $("#picUrl").finalselect({id:"picUrl",zIndex:1,selectWidth: '145px',viewWidth:'400px',viewHeight:'400px',selectImage:'img/select.png', selectText:'Pildi valimine:'});
     <?
     //Loetleb pildid
     $dir = opendir("../../images");
     while($entryName = readdir($dir)) {
        if($entryName != "." && $entryName != "..") {
            print "\tpicBox.addItem('<img src=\"../images/".$entryName."\" /><br /><span style=\"font-weight: bold; \" class=\"thistext\">".$entryName."</span>','');\n";
        }
     }
     closedir($dir);
     ?>
     $("div .selectitem").bind("click", function(e){
     $("input[name=q_pic]").attr("value",picBox.getText());          
     });
  });